package com.example.listview;

import android.os.Parcel;
import android.os.Parcelable;

public class Product implements Parcelable{
    private int id;
    private String name;
    private String taks;
    private String category;
    
    public Product(){
        super();
    }
    
    public Product(int id, String name, String taks,String category) {
        super();
        this.id = id;
        this.name = name;
        this.taks = taks;
        this.category=category;
    }
    public Product(Parcel in) {
        id = in.readInt();
        name = in.readString();
        taks = in.readString();
        category = in.readString();
    }

    @Override
    public String toString() {
        return this.name+" podatek: "+this.taks;
    }
    public String getTask(){
    	return taks;
    }

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeString(name);
		dest.writeString(category);
		dest.writeString(taks);
		
	}
	public static final Parcelable.Creator<Product> CREATOR = new Parcelable.Creator<Product>() {
        public Product createFromParcel(Parcel in) {
            return new Product(in);
        }

        public Product[] newArray(int size) {
            return new Product[size];
        }
    };
	
}